<extend name="Public/header"/>
<block name="main">
<body class="bgeee">
    <div class="header-container">
        <div class="weui-cell">
            <div class="weui-cell__hd fs0">
                <img src="__WEBPUBLIC__/Home/img/lefticon.png" class="slimg" />
            </div>
            <div class="weui-cell__bd texcen">
                <p>举报人身份验证</p>
            </div>
        </div>
    </div>
    <div class="xq_container">
        <div class="pad10 colbbb">举报人身份验证</div>
        <div class="weui-cells mat0 uinput ">
            <div class="weui-cell">
                <div class="weui-cell__hd">姓名</div>
                <div class="weui-cell__bd">
                    <input type="text" name="" class="weui-input name" placeholder="输入您的姓名" />
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">身份证号</div>
                <div class="weui-cell__bd">
                    <input type="text" name="" class="weui-input cardid" placeholder="输入您的身份证号" />
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">手机号码</div>
                <div class="weui-cell__bd">
                    <input type="text" name="" class="weui-input account" placeholder="输入您的手机号码" />
                </div>

            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd">验证码</div>
                <div class="weui-cell__bd">
                    <input type="text" name="" class="weui-input code" placeholder="输入短信验证码" />
                </div>
                <div class="fs0">
                    <a href="javascript:;" class="weui-btn weui-btn_mini bgff0 fs0-8 getcode">点击获取</a>
                </div>
            </div>
            <div class="weui-btn-area">
                <a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips">下一步</a>
            </div>
        </div>

    </div>
</body>
</block>
<block name="footerjs">
<script>
    getCode("{:U('Member/getCode')}"); 
    var jbdata = sessionStorage.getItem( 'jbdata' );
    $("#showTooltips").on('click',function () {
        var name = $(".name").val();
        var cardid = $(".cardid").val();
        var account = $(".account").val();
        var code = $(".code").val();
        var data = {
            name:name,
            cardid:cardid,
            account:account,
            code:code,
        };
        requestUrl("{:U('Member/yanInfo')}",data,function (res) {
            if (res.flag=="success") {
                putData();
            }else{
                layer.msg( res.message );
            }
        })
    });


    function putData() {
        var dataobj = JSON.parse(jbdata);
        requestUrl("{:U('Jubao/addjb')}",dataobj,function ( res ) {
            if ( res.flag == "success") {
                console.log( res );
                window.location.href = "{:U('Jubao/jbres')}/cardid/"+dataobj.idcardno;
            }else{
                layer.msg( res.message );
            }
        });
    }
</script>
</block>